<#assign pageName="操作日志管理">
<#assign businessTypeList = {"1":"新增", "2":"修改", "3":"删除", "4":"授权", "5":"导出","6":"导入","7":"强退","8":"清除数据","0":"其他"}>
<@override name="page-content">
<form class="layui-form form-horizontal" role="form" method="post">
    <div class="layui-form-search panel">
        <input type="text" hidden="hidden" name="_STATE"/>
         <@ctrl.SingleSelectQuery path="sysOperLog.status" options={"0":"正常", "1":"异常"} text="1" value="0" labelText="操作状态">
            <option value="">—请选择操作状态—</option>
        </@ctrl.SingleSelectQuery>
        <@ctrl.SingleSelectQuery path="sysOperLog.businessType" options=businessTypeList![] text="1" value="0" labelText="业务类型">
            <option value="">—请选择业务类型—</option>
        </@ctrl.SingleSelectQuery>
        <@ctrl.SingleSelectQuery path="sysOperLog.operatorType" options={"1":"后台用户", "2":"手机端用户", "0":"其他"} text="1" value="0" labelText="操作类别">
            <option value="">—请选择操作类别—</option>
        </@ctrl.SingleSelectQuery>
         <@ctrl.TextboxQuery path="sysOperLog.operIp" labelText="操作IP"/>
        <@ctrl.TextboxQuery path="sysOperLog.operName" labelText="操作用户"/>
        <@ctrl.DateQuery path="sysOperLog.queryStartDate" labelText="开始时间"/>
        <@ctrl.DateQuery path="sysOperLog.queryEndDate" labelText="截止日期"/>
        <div class="margin-5">
             <a href="javascript:;" onclick="$('form:first').submit();" class="layui-btn layui-btn-sm">
                 <i class="layui-icon layui-icon-search"></i>查询
             </a>
             <a href="javascript:;" class="layui-btn layui-btn-warm layui-btn-sm js-reset">
                <i class="layui-icon layui-icon-refresh-1"></i>重置
             </a>
         </div>
    </div>
    <table class="layui-table">
        <thead>
            <tr>
                <th class="align-center" width="50px" nowrap="nowrap">序号</th>
                <th class="align-center" nowrap="nowrap">操作状态</th>
                <th class="align-center" nowrap="nowrap">操作模块</th>
                <th class="align-center layui-hide-xs" nowrap="nowrap">业务类型</th>
                <th class="align-center layui-hide-xs">请求方式</th>
                <th class="align-center layui-hide-xs">操作类别</th>
                <th class="align-center">操作用户</th>
                <th class="align-center">操作IP</th>
                <th class="align-center">操作时间</th>
                <th class="align-center" width="100px">操作</th>
            </tr>
        </thead>
        <tbody>
            <#if queryResult.rows?has_content>
                <#list queryResult.rows as dataItem>  
                <tr>
                    <td class="align-center" width="50px" nowrap="nowrap">
                        ${(pageNo-1)*pageSize+dataItem_index+1}
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        <#if dataItem.status == "0">
                            <font color="green">正常</font>
                        <#elseif dataItem.status == "1">
                            <font color="red">异常</font>
                        </#if>
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        ${dataItem.title}
                    </td>
                    <td class="align-center layui-hide-xs" nowrap="nowrap">
                        <#list businessTypeList?keys as key>
                          <#if key == dataItem.businessType>
                              ${businessTypeList[key]}
                          </#if>
                        </#list>
                    </td>
                    <td class="align-center layui-hide-xs" nowrap="nowrap">
                        ${dataItem.requestMethod}
                    </td>
                      <td class="align-center layui-hide-xs" nowrap="nowrap">
                        <#if dataItem.operatorType == '1'>后台用户
                        <#elseif dataItem.operatorType == '2'>手机端用户
                        <#elseif dataItem.businessType == '0'>其他
                        </#if>
                    </td>
                    <td class="align-center" >
                        ${dataItem.operName}
                    </td>
                    <td class="align-center">
                        ${dataItem.operIp}
                    </td>
                    <td class="align-center">
                        ${dataItem.operTime}
                    </td>
                    <td class="align-center">
                        <div class="layui-table-cell">
                            <a href="detail/${dataItem.operId}"  class="layui-btn layui-btn-normal layui-btn-xs" >
                                <i class="layui-icon layui-icon-file"></i>详情
                            </a>
                        </div>
                    </td>
                </tr>
                </#list>
            <#else>
                 <tr>
                    <td colspan="10" style="color:red;text-align:center;font-weight:bold;">暂无符合条件的日志信息</td>
                 </tr>
            </#if>
            </tbody>
        </table>
        <@ctrl.pageShow (queryResult.total)!0, (queryResult.pageIndex)!0 />
    </form>
</@override>
<@override name="page-scripts">
      <script>
        $(function(){
            layui.use(['form','layer','laydate','jquery'], function(){
                var form=layui.form;
                var layer=layui.layer;
                var laydate = layui.laydate;
                var $ = layui.jquery;
                laydate.render({
                  elem: '#queryStartDate'
                });
                laydate.render({
                    elem: '#queryEndDate'
                });
                $('.js-reset').on('click', function(){
                    $('#pageNo').val(1);
                    $('#status').val("");
                    $('#businessType').val("");
                    $('#operatorType').val("");
                    $('#operIp').val("");
                    $('#operName').val("");
                    $('#queryStartDate').val("");
                    $('#queryEndDate').val("");
                    $('form:first').submit();
                })
            })
        })
    </script>
</@override>
<@extends name="/layout/basepage.html"/> 
